"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.灵阵 = exports.阵法 = void 0;
const Big_1 = require("../core/Big");
const Point_1 = require("../core/Point");
const GameUtils_1 = __importDefault(require("../GameUtils"));
var 阵法;
(function (阵法) {
    阵法["\u672A\u5E03\u7F6E"] = "\u672A\u5E03\u7F6E";
    阵法["\u8FF7\u96FE\u68EE\u6797"] = "\u8FF7\u96FE\u68EE\u6797";
    阵法["\u4F5B\u6CD5\u6148\u60B2"] = "\u4F5B\u6CD5\u6148\u60B2";
    阵法["\u4E5D\u66F2\u9EC4\u6CB3"] = "\u4E5D\u66F2\u9EC4\u6CB3";
    阵法["\u5730\u72F1\u6740\u4F10"] = "\u5730\u72F1\u6740\u4F10";
})(阵法 = exports.阵法 || (exports.阵法 = {}));
class 灵阵 extends Big_1.Big {
    constructor() {
        super(...arguments);
        this.isUsed = false;
        this.type = 阵法.未布置;
        this.arr_points = Array();
    }
    turnStart() {
        if (!this.isUsed) {
            this.actionTime = 1;
        }
        this.update();
    }
    die(murderer, effect_point_id = null, is_show_effect = true) {
        for (let p of this.arr_points) {
            p.removeMark(this);
        }
        super.die(murderer, effect_point_id, is_show_effect);
    }
    布阵(type, point) {
        this.isUsed = true;
        this.arr_points = GameUtils_1.default.getArrPointsAround1And2(this.gameMgr, point);
        this.arr_points.push(point);
        for (let p of this.arr_points) {
            p.addMark(type, this);
        }
        this.actionTime = 0;
    }
    terrainAdapt() {
        switch (this.point.terrain) {
            case Point_1.Terrain.SHAN:
            case Point_1.Terrain.SHUI:
                this.die(this.player);
        }
    }
}
exports.灵阵 = 灵阵;
